﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TE3;
using TE3.Utils;

namespace TE3
{
	public class Entity
	{
		public Int2 Position;
		public Int2 Size;
	}
	public class DrawableEntity : Entity,IDrawable
	{
		public Color Color;
		public string TextureName;

		public byte Alpha
		{
			get
			{
				return Color.A;
			}
			set
			{
				if (value > 255)
					value = 255;
				else if (value < 0)
					value = 0;
				Color.A = value;
			}
		}
		public void Draw(SpriteBatch spriteBatch, GraphicsDevice device, TextureHandler handler)
		{
			spriteBatch.Draw(handler.Textures[TextureName],new Rectangle(Position.X, Position.Y, Size.X, Size.Y), Color);
		}
	}
}
